package com.codedancer.campus.po;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.codedancer.campus.common.typehandler.CodeEnumTypeHandler;
import com.codedancer.campus.enums.CommentReportStatus;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@TableName(value = "comment_report", autoResultMap = true)
@Table(name = "comment_report", comment = "评论举报")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class CommentReport {

  @TableId
  @TableField("uuid")
  @Column(name = "uuid", type = MySqlTypeConstant.VARCHAR, length = 36, isKey = true, isNull = false, comment = "uuid")
  private String uuid;

  @TableField("comment_report_type_uuid")
  @Column(name = "comment_report_type_uuid", type = MySqlTypeConstant.VARCHAR, length = 36, isNull = false, comment = "评论举报类型uuid")
  private String commentReportTypeUuid;

  @TableField("report_user_uuid")
  @Column(name = "report_user_uuid", type = MySqlTypeConstant.VARCHAR, length = 36, isNull = false, comment = "举报用户uuid")
  private String reportUserUuid;

  @TableField("reported_user_uuid")
  @Column(name = "reported_user_uuid", type = MySqlTypeConstant.VARCHAR, length = 36, isNull = false, comment = "被举报用户uuid")
  private String reportedUserUuid;

  @TableField("report_reason")
  @Column(name = "report_reason", type = MySqlTypeConstant.TEXT, isNull = true, comment = "举报原因")
  private String reportReason;

  @TableField(value = "status", typeHandler = CodeEnumTypeHandler.class)
  @Column(name = "status", type = MySqlTypeConstant.TINYINT, length = 1, isNull = false, comment = "评论举报状态 1表示待审核 2表示存在违规 3表示不存在违规")
  private CommentReportStatus status;

  @TableField("examine_result")
  @Column(name = "examine_result", type = MySqlTypeConstant.TEXT, isNull = true, comment = "审核结果")
  private String examineResult;

  @TableField("deleted")
  @Column(name = "deleted", type = MySqlTypeConstant.TINYINT, length = 1, isNull = false, comment = "是否删除 1表示删除 0表示未删除", defaultValue = "0")
  private Short deleted;

  @Column(name = "create_time", type = MySqlTypeConstant.DATETIME, isNull = false, comment = "创建时间")
  @TableField(fill = FieldFill.INSERT_UPDATE)
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  private Date createTime;

  @Column(name = "update_time", type = MySqlTypeConstant.DATETIME, isNull = false, comment = "更新时间")
  @TableField(fill = FieldFill.INSERT_UPDATE)
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  private Date updateTime;
}
